//
//  GameViewController.m
//  iFly
//
//  Created by User-10 on 11/26/14.
//  Copyright (c) 2014 TeamDifferent. All rights reserved.
//

#import "GameViewController.h"
#import "GameScene.h"
#import "MainMenuScene.h"
#import "SoundHandler.h"

@implementation SKScene (Unarchive)

@end

@implementation GameViewController

- (void)viewWillLayoutSubviews{
    [super viewWillLayoutSubviews];
    
    SKView * skView = (SKView *)self.view;
    
    if (!skView.scene) {
        skView.showsFPS = YES;
        skView.showsNodeCount = YES;
        
        [[SoundHandler sharedSoundPlayer] playBackgroundMusicWithURL:@"IronManSong" andExtension:@"mp3"];
        
        // Create and configure the scene.
        SKScene * scene = [MainMenuScene sceneWithSize:skView.bounds.size];
        scene.scaleMode = SKSceneScaleModeAspectFill;
        // Present the scene.
        [skView presentScene:scene];
    }
    
}
- (BOOL)prefersStatusBarHidden {
    return YES;
}

-(BOOL)shouldAutorotate {
    return YES;
}

-(NSUInteger)supportedInterfaceOrientations {
    return UIInterfaceOrientationMaskLandscapeLeft|UIInterfaceOrientationMaskLandscapeRight;
}

@end
